package com.ddyx.service.product.api.entity;

import com.baomidou.mybatisplus.annotation.IdType;
import com.baomidou.mybatisplus.annotation.TableId;
import com.baomidou.mybatisplus.annotation.TableName;
import com.baomidou.mybatisplus.extension.activerecord.Model;
import lombok.AllArgsConstructor;
import lombok.Data;
import lombok.NoArgsConstructor;

import java.io.Serializable;
import java.time.LocalDateTime;

/**
 * <p>
 * 商品
 * </p>
 *
 * @author agula
 * @since 2019-08-06
 */
@Data
@AllArgsConstructor
@NoArgsConstructor
@TableName("p_goods")
public class Goods extends Model<Goods> {

    private static final long serialVersionUID=1L;

    /**
     * 商品ID
     */
    @TableId(value = "goods_id", type = IdType.AUTO)
    private Integer goodsId;

    /**
     * 品牌ID
     */
    private Integer brandId;

    /**
     * 类目ID
     */
    private Integer categoryId;

    /**
     * 商品名称
     */
    private String goodsName;

    /**
     * 商品编码
     */
    private String goodsCode;

    /**
     * 商品描述
     */
    private String goodsDesc;

    /**
     * SPU编码
     */
    private String spuCode;

    /**
     * SPU外部编码
     */
    private String spuOuterId;

    /**
     * 是否禁用,0：否（禁用状态），1：是（启用状态），默认0
     */
    private Integer isLocked;

    /**
     * 是否删除,0：否，1：是，默认0
     */
    private Integer isDeleted;

    /**
     * 创建时间
     */
    private LocalDateTime gmtCreate;

    /**
     * 修改时间
     */
    private LocalDateTime gmtModified;


    @Override
    protected Serializable pkVal() {
        return this.goodsId;
    }

    @Override
    public String toString() {
        return "Goods{" +
        "goodsId=" + goodsId +
        ", brandId=" + brandId +
        ", categoryId=" + categoryId +
        ", goodsName=" + goodsName +
        ", goodsCode=" + goodsCode +
        ", goodsDesc=" + goodsDesc +
        ", spuCode=" + spuCode +
        ", spuOuterId=" + spuOuterId +
        ", isLocked=" + isLocked +
        ", isDeleted=" + isDeleted +
        ", gmtCreate=" + gmtCreate +
        ", gmtModified=" + gmtModified +
        "}";
    }
}
